﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MasterPage_New.master" AutoEventWireup="true"
    CodeBehind="WarningStart.aspx.cs" Inherits="HZ.Supervise.Web.Message.WarningStart" %>

<%@ Register Src="~/Common/QueryControl.ascx" TagName="QueryControl" TagPrefix="uc1" %>
<%@ Register Src="../Common/ChartControl.ascx" TagName="ChartControl" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script language="javascript" type="text/javascript">
        function check_isnum() {
            if ((window.event.keyCode > 95 && window.event.keyCode < 106)
              || (window.event.keyCode > 47 && window.event.keyCode < 59)
              || window.event.keyCode == 8
              || window.event.keyCode == 9
              || window.event.keyCode == 46
              || window.event.keyCode == 37
              || window.event.keyCode == 38
              || window.event.keyCode == 39
              || window.event.keyCode == 40) {

                return true;
            }
            else {

                return false;
            }
        }

        //按Enter键查询 by张雄
        function document.onkeydown() {
            //使用document.getElementById获取到按钮对象
            var btn = document.getElementById('<%=btnQuery.ClientID%>');
            //判断Enter键的键值
            if (event.keyCode == 13) {
                //触发事件
                btn.click();
                //阻止浏览器执行与事件相关的动作
                event.returnValue = false;
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="tabnav">
        <ul>
            <li><a href="WarningStop.aspx">已启动的预警</a></li>
            <li class="active"><a href="javascript:void(0);">已禁用的预警</a></li>
        </ul>
    </div>
    <div id="tabcontent">
        <table class="querylist">
            <tr>
                <%-- <td align="right">
                          药品类别
                      </td>
                      <td>
                          <asp:TextBox ID="txtDrugSort" runat="server"></asp:TextBox>
                      </td>  --%>
                <td align="right">
                    预警金额
                </td>
                <td>
                    <asp:TextBox ID="txtAmount" runat="server" MaxLength="12" onkeydown="javascript:return check_isnum();"></asp:TextBox>
                </td>
                <td align="right">
                    预警数量
                </td>
                <td>
                    <asp:TextBox ID="txtCount" runat="server" MaxLength="12" onkeydown="javascript:return check_isnum();"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    预警级别
                </td>
                <td>
                    <asp:DropDownList ID="ddlLevel" runat="server" Height="20px" Width="123px">
                        <asp:ListItem Text="--全部--" Value="0"></asp:ListItem>
                        <asp:ListItem Text="一级预警" Value="1"></asp:ListItem>
                        <asp:ListItem Text="二级预警" Value="2"></asp:ListItem>
                        <asp:ListItem Text="三级预警" Value="3"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td align="right">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td colspan="2">
                    <asp:Button ID="btnQuery" CssClass="btn" runat="server" Text="查询" OnClick="btnQuery_Click" />
                </td>
            </tr>
        </table>
    </div>
    <asp:GridView runat="server" ID="gvwWarningStart" CssClass="mainlist" AutoGenerateColumns="False"
        EmptyDataText="暂无制定的规则！" OnRowDataBound="gvwWarningStart_RowDataBound" DataKeyNames="MessageDetailId">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemTemplate>
                    <%# Container.DataItemIndex + 1 + AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1)%></ItemTemplate>
                <HeaderStyle Width="30px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="预警对象">
                <ItemTemplate>
                    <asp:Label ID="lblHospitalName" ToolTip='<%#Eval("HospitalName") %>' runat="server"
                        Text='<%#Eval("HospitalName") %>' ReadOnly="true"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="地区">
                <ItemTemplate>
                    <asp:Label ID="lblAreaName" ToolTip='<%#Eval("AreaName") %>' runat="server" Text='<%#Eval("AreaName") %>'
                        ReadOnly="true"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="TypeName" HeaderText="类型" ReadOnly="true" />
            <asp:TemplateField HeaderText="药品名">
                <ItemTemplate>
                    <asp:Label ID="lblProductName" ToolTip='<%#Eval("ProductName") %>' runat="server"
                        Text='<%#Eval("ProductName") %>' ReadOnly="true"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
<%--            <asp:BoundField DataField="addDataColumn" HeaderText="采购类型" />
--%>            <asp:TemplateField HeaderText="类别">
                <ItemTemplate>
                    <asp:Label ID="lblSortName" ToolTip='<%#Eval("SortName") %>' runat="server" Text='<%#Eval("SortName") %>'
                        ReadOnly="true"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="AddTime" HeaderText="添加时间" DataFormatString="{0:d}" ReadOnly="true" />
            <asp:TemplateField HeaderText="触发条件">
                <ItemTemplate>
                    <%#Eval("SqlDescription") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Level" HeaderText="预警级别" ControlStyle-Width="80px" ReadOnly="true" />
            <asp:TemplateField>
                <HeaderTemplate>
                    <input id="addTable_chkAll" name="chkAll" class="chkAll" type="checkbox" onclick="$('input[type=checkbox]').attr('checked', this.checked);" />
                </HeaderTemplate>
                <ItemTemplate>
                    <input type="checkbox" name="chk" class="item" id="chk" value='<%#Eval("MessageDetailId")%>' />
                </ItemTemplate>
                <HeaderStyle Width="25px" />
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div class="page">
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged">
        </webdiyer:AspNetPager>
    </div>
    <div class="listctrl">
        <hz:HzButton ID="btnDelte" CssClass="btn" OnClientClick="if(getcheckcount('请至少选择一个要删除的预警')){ return confirm('确定要删除所选的预警吗？');} return false;"
            runat="server" Text="删除" OnClick="btnDelte_Click" ModuleNo="预警控制" OperateType="删除" />
        <hz:HzButton ID="btnStart" CssClass="btn" OnClientClick="if(getcheckcount('请至少选择一个要启用的预警')){ return confirm('确定要启用所选的预警吗？');} return false;"
            runat="server" Text="启用" OnClick="btnStart_Click" ModuleNo="预警控制" OperateType="启用" />
    </div>
</asp:Content>
